import { ref } from "vue";

// utils/tabbar.js
export const useTabBar = () => {
  const currentIndex = ref(0);

  const setCurrentIndex = (path: string) => {
    const routes = [
      "/pages/index/index",
      "/pages/dynamic/dynamic",
      "/pages/wonderful/wonderful",
      "/pages/search/search",
      "/pages/mine/mine",
    ];
    currentIndex.value = routes.indexOf(path);
  };

  return { currentIndex, setCurrentIndex };
};
